export default {
    state: {
        historys: ['一体机']
    },
    mutations: {
        ADD_HISTORYS(state,value){
            state.historys.push(value)
        },
        CLEAR_HISTORY(state){
            state.historys=[]
        },
        DELETE_HISTORY(state,value){
            state.historys=state.historys.filter((history,index)=>history !== value)
        }        
    },
    actions: {
        // 添加历史记录
        addHistorys({commit},value){
            commit('ADD_HISTORYS',value)
        },
        // 清空历史记录
        clearHistorys({commit}){
            commit('CLEAR_HISTORY')
        },
        // 删除单条历史数据
        deleteHistory({commit},value){
            commit('DELETE_HISTORY',value)
        }
    },
    getters: {}
}